The motor driving apparatus is composed of a motor driving circuit functionally interposed between an alternating-current power source and a motor, a control circuit that calculates and generates a control signal that causes the motor driving circuit to drive the motor in a desired manner, and an operation power generating system for internal circuits. The operation power generating system for the internal circuits is configured to generate a control voltage necessary for the internal circuits, such as the control circuit and the driving circuit that generates a driving signal to a plurality of switching elements in the motor driving circuit from the control signal, from charge voltage of a smoothing capacitor that smoothes voltage obtained by rectifying alternating-current voltage supplied from the alternating-current power source. With this power supply configuration, when a power failure in which alternating-current power is interrupted occurs, power supply to the internal circuits is not immediately interrupted and continues for a short time after the power failure by the energy stored in the smoothing capacitor.
The motor driving apparatus incorporated in a machining apparatus has a configuration in which, with the use of this power supply configuration, the control circuit forcibly stops the motor for preventing damage or the like of the machining apparatus by the motor that rotates by inertia when a power failure in which alternating-current power input is interrupted occurs.
Specifically, the control circuit is configured to monitor changes in the charging voltage of the smoothing capacitor in parallel with calculation output control of a control signal to the motor driving circuit with the control voltage generated from the charging voltage of the smoothing capacitor as an operating voltage, and to determine when detecting that the charging voltage has become low voltage below a threshold, that occurrence of a power failure has been detected, and perform an abnormal end process of calculating and generating a control signal that forcibly stops the motor and outputting it to the driving circuit in the motor driving circuit by the time the charging voltage of the smoothing capacitor drops to near the voltage (that is, the voltage at which the control circuit becomes inoperable) at which the control voltage cannot be generated.